package karma.main;

import net.minecraft.client.Minecraft;
import net.minecraft.src.*;

import org.lwjgl.input.Keyboard;

public class ItemHellLegs extends ItemArmor
{
	public static boolean allowJump;
	
    
	public ItemHellLegs(int i, EnumArmorMaterial enumarmormaterial, int j, int k)
    {
        super(i, enumarmormaterial, j, k);
    }

    /**
     * Return an item rarity from EnumRarity
     */
    public EnumRarity getRarity(ItemStack itemstack)
    {
        return mod_KarmaCraft.ENCHANTED;
    }
    
    public static void checkIfWorn(Minecraft mc)
    {
        if (mc.thePlayer.inventory.armorInventory[1] != null && mc.thePlayer.inventory.armorInventory[1].getItem() == mod_KarmaCraft.HellLegs)
        {
            doSpecial(mc);
            
            
            
        }
    }
    
    public static void doSpecial(Minecraft minecraft)
    {
        if (!minecraft.thePlayer.onGround && allowJump && minecraft.thePlayer.isSneaking())
        {
            minecraft.thePlayer.setVelocity(minecraft.thePlayer.motionX, minecraft.thePlayer.motionY * 3.0499999999999998D, minecraft.thePlayer.motionZ);
            allowJump = false;
            minecraft.thePlayer.inventory.armorInventory[1].damageItem(2, minecraft.thePlayer);
        }

        if (minecraft.thePlayer.onGround)
        {
            allowJump = true;
        }
    }
}
